//
//  MyNavigationView.m
//  Everest
//
//  Created by 李其昌 on 14/12/19.
//  Copyright (c) 2014年 ThreeL. All rights reserved.
//

#import "MyNavigationView.h"

@implementation MyNavigationView

- (void)dealloc
{
    [_button release];
    [_label release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.frame = frame;
        // 设置其颜色
        self.backgroundColor = [UIColor colorWithRed:248/255.0 green:248/255.0 blue:248/255.0 alpha:0.9];
        // 设置layer层的边框
        [[self layer] setBorderWidth:1.1];
        // 设置边框的颜色为
        [[self layer] setBorderColor:[UIColor colorWithRed:216/255.0 green:216/255.0 blue:216/255.0 alpha:1].CGColor];
        
        self.label = [[UILabel alloc] initWithFrame:CGRectMake(frame.size.width / 4, 20, frame.size.width / 2, frame.size.height - 20)];
        self.label.textAlignment = NSTextAlignmentCenter;
        self.label.backgroundColor = [UIColor colorWithRed:248/255.0 green:248/255.0 blue:248/255.0 alpha:0.9];
        self.label.font = [UIFont boldSystemFontOfSize:18];
        [self addSubview:self.label];
        [_label release];
        
        self.button = [UIButton buttonWithType:UIButtonTypeSystem];
        self.button.frame = CGRectMake(10, frame.size.height / 2, 50, frame.size.height / 2 - 10);
        [self addSubview:self.button];
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
